package com.meida.module.bus.provider.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.GetInterceptor;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.user.client.entity.AppUser;
import com.meida.module.user.client.entity.AppWorkhistory;
import org.springframework.stereotype.Component;

/**
 * 后台用户工作经历列表
 */
@Component
public class AppWorkhistoryGetHandler implements GetInterceptor {

    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.clear();
        cq.select(AppWorkhistory.class, "workhistoryId", "parentId", "companyName", "positionName", "state", "companyAddress", "workingDate", "createTime");
        cq.select(AppUser.class, "userName");
        cq.eq(AppWorkhistory.class, "state");
        cq.like(AppUser.class, "userName");
        cq.createJoin(AppUser.class).setMainField("userId").setJoinField("userId");
    }
}
